<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  class Parent{
    constructor(msg){
      this.msg = msg;
    }
    show(){
      console.log(this.msg);
    }
  }

  class Child extends Parent {
    constructor(msg){
      super(msg);
    }
  }

  const p = new Parent("admin");
  console.log(p);
  p.show();

  const c = new Child("root");
  console.log(c);
  c.show();



  // 父类是子类的超类



  
</script>
</html>